<div class="SipeiMain_r fr">
    <h2 class="clearfix fonts_18 height45 fontc_444"><?php echo $this->title; ?></h2> 
    <div class="clearfix back_bgf border_3 border_c pt20 pr30 pb20 height32 fontc_666">
        <form action="<?php echo $this->createUrl('index'); ?>" method="get"  id='searchForm'>
            <table>
                <tbody>
                    <tr>
                        <td align="right" width="88" class="pt10 pr3 pb10">学校代码：</td>
                        <td width="120" class="pt10 pb10">
                            <input type="text" name="school_code" value="<?php echo stripslashes($serch['school_code']); ?>" class="pt6 pr5 pb6 pl5 border_3 border_c fontc_666 w100" />
                        </td>
                        <td align="right" width="75" class="pt10 pr3 pb10">上报简称：</td>
                        <td width="120" class="pt10 pb10">
                            <input type="text" name="school_nick" value="<?php echo stripslashes($serch['school_nick']); ?>" class="pt6 pr5 pb6 pl5 border_3 border_c fontc_666 w100" />
                        </td>
                        <td align="right" width="75" class="pt10 pr3 pb10">学校名称：</td>
                        <td width="120" class="pt10 pb10">                            
                            <input type="text" name="school_name" value="<?php echo stripslashes($serch['school_name']); ?>" class="pt6 pr5 pb6 pl5 border_3 border_c fontc_666 w100" />
                        </td>
                        <td width="160" class="pt10 pb10 text_right">
                            <input type="submit" value="查询" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor" />
                        </td>
                    </tr>
                    <tr>
                        <td  align="right"class="pt10 pr3">学段：</td>
                        <td class="pt10">
                            <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3"> 
                                <span class="fl select_shelter select_shelter2"> 
                                    <select class="fl fontc_666" name="edu_type">
                                        <option value="0">请选择</option>
                                        <?php if (!empty($edu_type)): ?>
                                            <?php foreach ($edu_type as $ev): ?>
                                                <option value="<?php echo $ev['edu_id']; ?>" <?php
                                                if ($serch['edu_type'] == $ev['edu_id']): echo "selected";
                                                endif;
                                                ?>><?php echo $ev['edu_name']; ?></option>
                                                    <?php endforeach; ?>
                                                <?php endif; ?>
                                    </select> 
                                </span> 
                            </span>
                        </td><!--
                        <td align="right" class="pt10 pr3">是否生效&nbsp;&nbsp;&nbsp;&nbsp;</td>
                        <td colspan="4" class="pt10">
                            <input type="checkbox" name="is_display" value="1" class="" />
                        </td>
                    --></tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class="clearfix back_bgf border_c mt15 pt20 pb20">
        <div class="clearfix pb20 pl30">
            <input type="button" value="新增" onclick="add();" style="margin-right:30px;" class="fr b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor" />
        	<input type="button" value="删除" onclick="delete_all()" 	 class="fl b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor" />
        </div>
        <form>
            <table class="height40">
                <thead class="back_bgf5 fontc_666">
                    <tr>                        
                    	<th width="40" align="right" class="m_hr_t m_hr_b pr10"><input type="checkbox" class="checkboxs"></th>
                        <th width="110" align="center" class="m_hr_t m_hr_b pr5">代码</th>
                        <th width="110" align="center" class="m_hr_t m_hr_b pr5">上报简称</th>
                        <th width="110" align="center" class="m_hr_t m_hr_b pr5">学校名称</th>
                        <th width="110" align="center" class="m_hr_t m_hr_b pr5">学段</th>
                        <th width="65" align="center" class="m_hr_t m_hr_b">是否生效</th>
                        <th width="160" align="center" class="m_hr_t m_hr_b pr5">备注</th>
                        <th width="90" align="center" class="m_hr_t m_hr_b">操作</th>
                    </tr>
                </thead>
                <tbody class="fontc_444">
                    <?php if (!empty($data)): ?>
                        <?php foreach ($data as $value): ?>
                            <tr>
                            	<td align="right" class="m_hr_b pr10"><input type="checkbox" name="deleteAll[]" value="<?php echo $value['school_id'];?>" class="checkbox"></td>
                                <td align="center" class="m_hr_b height20 pt5 pr5 pb5"><?php echo $value['school_code']; ?></td>
                                <td align="center" class="m_hr_b height20 pt5 pr5 pb5"><?php echo $value['school_nick']; ?></td>
                                <td align="center" class="m_hr_b height20 pt5 pr5 pb5"><?php echo $value['school_name']; ?></td>
                                <td align="center" class="m_hr_b height20 pt5 pr5 pb5"><?php echo ($value['bis_del'] == 0 && $value['bdisabled'] == 1) ? $value['edu_name'] : $value['edu_name']; ?></td>
                                <?php if ($value['disabled'] == 1): ?>
                                    <td align="center"  class="m_hr_b">
                                        <input type="checkbox" disabled='' checked="checked" />
                                    </td>
                                <?php else: ?>
                                    <td align="center"  class="m_hr_b">
                                        <input type="checkbox" disabled='' />
                                    </td>
                                <?php endif; ?>				
                                <td align="center" class="m_hr_b height20 pt5 pb5" title="<?php echo $value['description'];?>"><?php echo (!empty($value['description'])) ? Func::get_word($value['description'], 15) : $value['description']; ?></td>				
                                <td align="center" class="m_hr_b">
                                    <img src="/themes/default/images/Sipei/edit.png" title="编辑" class="mr10 cursor" onclick="update(<?php echo $value['school_id']; ?>)" />
                                    <img src="/themes/default/images/Sipei/delate.png" title="删除" onclick="set_ok(<?php echo $value['school_id']; ?>,<?php echo $value['disabled'];?>)" class="cursor" />
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    <?php else: ?>
                        <tr>
                            <td colspan="8"><h1 align="center">暂无数据</h1></td>
                        </tr>
                    <?php endif; ?>			 
                </tbody>
            </table>
        </form>
        <?php $this->renderPartial('//partial/partial_pager', array('pages' => $pages, "url" => $pageUrl)); ?>
    </div>
</div>
<script>
                function set_ok(school_id,is_del) {
           
                    $.dialog.confirm('确定删除吗', function() {
                        $.get('/school_info/default/delete_all', {school_id: school_id}, function(data) {
                			location.reload();
                		});
                    });
                }

                function delete_all(){
                	var aa='';
                		$("input[name='deleteAll[]']:checkbox:checked").each(function(){
						aa+=$(this).val()+',';
					});
					if(aa == ''){
						$.dialog.alert("请选择要删除条目");
						return false;
					}
					$.dialog.confirm('确定删除所选数据吗', function() {
                		aa+=0;
                	
                		$.get('/school_info/default/delete_all', {school_id: aa}, function(data) {
                			location.reload();
                		   
                		});
                	});
                }
                
                function add() {
                    api = $.dialog({
                        id: 'testID2',
                        lock: true,
                        padding: 0,
                        fixed: true,
                        title: "新增",
                        width: 490,
                        height: 470,
                        max: false,
                        min: false
                    });
                    $.get('/school_info/default/add', function(html) {
                        api.content(html);
                    });
                }

                function update(school_id) {

                    api = $.dialog({
                        id: 'testID2',
                        lock: true,
                        padding: 0,
                        fixed: true,
                        title: "编辑",
                        width: 485,
                        height: 470,
                        max: false,
                        min: false
                    });
                    $.get('/school_info/default/update', {school_id: school_id,time:new Date()}, function(html) {
                        api.content(html);
                    });
                }
							$(function() {
                    $(".checkboxs").click(function() {
                        var checkedS = $(this).attr("checked");
                        if (checkedS) {
                            $(".checkbox").attr("checked", true)
                        } else {
                            $(".checkbox").removeAttr("checked")
                        }
                    })

                })
				</script>